#!/bin/bash

#sqoop list-databases --connect jdbc:mysql://192.168.56.104:3306/ --username root --password root
#sqoop list-tables --connect jdbc:mysql://192.168.56.104:3306/mydb --username root --password root

sqoop export \
--connect jdbc:mysql://192.168.56.104:3306/mydb \
--username root \
--password root \
--table dwd_fz_time_quantum \
--update-key user_id \
--update-mode allowinsert \
--export-dir /user/hive/warehouse/ob_dwd.db/dwd_fz_time_quantum \
--lines-terminated-by ',' \
--input-null-non-string '\\N' \
--input-null-string '\\N' \
--num-mappers 1


sqoop export \
--connect jdbc:mysql://192.168.56.104:3306/mydb \
--username root \
--password root \
--table dwd_fz_user_occupation \
--update-key user_id \
--update-mode allowinsert \
--export-dir /user/hive/warehouse/ob_dwd.db/dwd_fz_user_occupation \
--lines-terminated-by ',' \
--input-null-non-string '\\N' \
--input-null-string '\\N' \
--num-mappers 1


sqoop export \
--connect jdbc:mysql://192.168.56.104:3306/mydb \
--username root \
--password root \
--table dwd_fz_habitual_city \
--update-key user_id \
--update-mode allowinsert \
--export-dir /user/hive/warehouse/ob_dwd.db/dwd_fz_habitual_city \
--lines-terminated-by ',' \
--input-null-non-string '\\N' \
--input-null-string '\\N' \
--num-mappers 1

sqoop export \
--connect jdbc:mysql://192.168.56.104:3306/mydb \
--username root \
--password root \
--table dwd_fz_user_behavior \
--update-key user_id \
--update-mode allowinsert \
--export-dir /user/hive/warehouse/ob_dwd.db/dwd_fz_user_behavior \
--lines-terminated-by ',' \
--input-null-non-string '\\N' \
--input-null-string '\\N' \
--num-mappers 1


sqoop export \
--connect jdbc:mysql://192.168.56.104:3306/mydb \
--username root \
--password root \
--table dwd_fz_user_item \
--update-key user_id \
--update-mode allowinsert \
--export-dir /user/hive/warehouse/ob_dwd.db/dwd_fz_user_item \
--lines-terminated-by ',' \
--input-null-non-string '\\N' \
--input-null-string '\\N' \
--num-mappers 1

